LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

-- Dummy_RCV
-- 
-- Inputs:
-- clk = The clock.
-- reset = The reset signal.
-- FWD_to_RCV_LENGTH_ACK = Requests the RCV to send us the length in the next cycle
-- FWD_to_RCV_FRAME_ACK	= Requests the RCV to send us a byte of the data
--
-- Outputs:
-- RCV_to_FWD_DATA = A byte of the actual data
-- RCV_to_FWD_LENGTH = The Rightmost bit is a valid bit, the others are the frame length
-- RCV_to_FWD_FRAMEAVAILABLE = Whether or not RCV currently has an entire frame ready
--
-- This is a dummy RCV for testing purposes. It tells us that it is ready to send a message every cycle,
-- and doesn't care what we send it. This is to test for the absolute worst case scenario. If we add in 
-- counters, we have a more realistic simulation, but this should work for our purposes.
--
-- You can change the messages it sends to us below, it's all hard-coded in.

ENTITY Dummy_RCV IS
   PORT(
	   clk, reset			  	  : IN STD_LOGIC;
	   IN_FWD_to_RCV_LENGTH_ACK	  : IN STD_LOGIC;
	   IN_FWD_to_RCV_FRAME_ACK	  : IN STD_LOGIC;
	   OUT_RCV_to_FWD_DATA	  	  : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
	   OUT_RCV_to_FWD_LENGTH  	  : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
	   OUT_RCV_to_FWD_FRAMEAVAILABLE : OUT STD_LOGIC
       );
END Dummy_RCV;

ARCHITECTURE dummy_rcv_arch OF Dummy_RCV IS

--COMPONENT One_Bit_Register IS
--	PORT
--	(
--		aclr		: IN STD_LOGIC ;
--		clock		: IN STD_LOGIC ;
--		shiftin		: IN STD_LOGIC ;
--		shiftout		: OUT STD_LOGIC 
--	);
--END COMPONENT;
--
--COMPONENT Three_Bit_Counter_Prototype IS
--	PORT
--	(
--		aclr		: IN STD_LOGIC ;
--		clock		: IN STD_LOGIC ;
--		cnt_en		: IN STD_LOGIC ;
--		q		: OUT STD_LOGIC_VECTOR (2 DOWNTO 0)
--	);
--END COMPONENT;

BEGIN

-- Always indicate that RCV has a frame ready (Try adding a counter here to allow us to have larger timeouts between
-- new frames, and some control logic so it's not constantly 1.)

OUT_RCV_to_FWD_FRAMEAVAILABLE <= '1';

-- Dummy values for the length and message, you can mix these up if needed.
	   
OUT_RCV_to_FWD_DATA <= "11001100";
OUT_RCV_to_FWD_LENGTH <= "000000001000";
   
END dummy_rcv_arch;